<?php

/**
 * Class ModuleGroupActionLogic
 */
class ModuleGroupActionLogic extends Model
{
    private $_customerId = null;
    private $_modelModuleGroupAction = null;

    public function __construct()
    {
        $this->_customerId = Session::$user['customerId'];
        Session::switchCustomer(0);

        $this->_modelModuleGroupAction = D('ModuleGroupAction');

        Session::switchCustomer($this->_customerId);
    }

    /** --------------------------------------  增  -------------------------------------- */
    /** --------------------------------------  删  -------------------------------------- */
    /** --------------------------------------  改  -------------------------------------- */



    /** --------------------------------------  查  -------------------------------------- */

    /**
     * 根据moduleId查询这个module对应的功能点
     *
     * @param $moduleId
     * @return mixed
     */
    public function getActionByModuleId($moduleId)
    {
        return $this->_modelModuleGroupAction->where(['moduleId' => $moduleId])->getField('actionId', TRUE);
    }
}